package com.fyl.principles.demo2.after;


public class RectangleDemo {
    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setLength(20);
        rectangle.setWidth(10);
        resize(rectangle);
        printLengthAndWidth(rectangle);

    }
    //扩宽方法
    public static void resize(Rectangle rectangle){
        //判断宽如果比长小，进行扩宽的操作
        while (rectangle.getWidth()<= rectangle.getLength()){
            rectangle.setWidth(rectangle.getWidth()+1);
        }
    }
    //打印长和宽
    public static void printLengthAndWidth(Quadrilateral quadrilateral){
        System.out.println("quadrilateral.getLength() = " + quadrilateral.getLength());
        System.out.println("quadrilateral.getWidth() = " + quadrilateral.getWidth());
    }
}
